#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<fstream>

using namespace std;

class Date
{
public:
	
	Date()
	{}




	Date(int year,int month,int day)
		:_year(year),_month(month),_day(day)
	{}


	friend ostream& operator << (ostream& cout, Date& date);
	friend istream& operator >> (istream& cin, Date& date);
private:
	int _year;
	int _month;
	int _day;
};

ostream& operator << (ostream& cout, Date& date)
{
	cout << date._year << " " << date._month << " " << date._day << endl;
	return cout;
}

istream& operator >> (istream& cin, Date& date)
{
	cin >> date._year >> date._month >> date._day;
	return cin;
}


int main()
{
	Date d(2023, 11, 20);
	ofstream ofs("file.txt");
	ofs << d;

	ifstream ifs("file.txt");
	Date d2;
	ifs >> d2;

	cout << d2;
	return 0;
}